<html>
<head>
  <title>Hub - Topic Details - {{topic_url|escape}}</title>
  <link rel="stylesheet" href="/base.css" type="text/css">
  <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/favicon.ico">
</head>
<body>

<h1>Topic Details - {{topic_url|escape}}</h1>

{% if error %}
<div>{{error|escape}}</div>
{% else %}
<table cellspacing="0", cellpadding="3" border="0">
  {% if next_fetch %}
  <tr>
    <td>Next fetch time (UTC):</td>
    <td>{{next_fetch|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>Current fetch attempts:</td>
    <td>{{fetch_attempts}}</td>
  </tr>
  <tr>
    <td>All attempts failed</td>
    <td>{{totally_failed}}</td>
  </tr>
  {% endif %}
  <tr>
    <td>Last successful fetch (UTC):</td>
    <td>{{last_successful_fetch|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>Last Content-Type:</td>
    <td>{{last_content_type|escape}}</td>
  </tr>
  <tr>
    <td>Last ETag:</td>
    <td>{{last_etag|escape}}</td>
  </tr>
  <tr>
    <td>Last Modified:</td>
    <td>{{last_modified|escape}}</td>
  </tr>
  {% if subscriber_count %}
  <tr>
    <td>Active subscribers:</td>
    <td>{{subscriber_count}}</td>
  </tr>
  <tr>
    <td>Last count (UTC):</td>
    <td>{{feed_stats_update_time|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  {% endif %}
  <tr>
    <td>Fetch from domain:</td>
    <td>
      {% if fetch_blocked %}
        <span style="color: red">BLOCKED</span>
      {% else %}
        OK
      {% endif %}
    </td>
  </tr>
  <tr>
    <td>Fetch short-term:</td>
    <td>{{fetch_errors|floatformat:"-2"}}% errors for domain</td>
  </tr>
</table>

<h2>Error rate statistics</h2>
{% for result in fetch_url_error %}
  {% include "stats_table.html" %}
{% endfor %}

<h2>Latency statistics</h2>
{% for result in fetch_url_latency %}
  {% include "stats_table.html" %}
{% endfor %}

<h2>Last feed envelope retrieved:</h2>
<pre>
{{last_header_footer|escape}}
</pre>
{% endif %}

</body>
</html>
